Filter hook 'theme_mod_{$name}'

in WP Core File wp-includes/theme.php at line 1082

View Source

theme_mod_{$name}

Filter Hook
Description
Filters the theme modification, or 'theme_mod', value. The dynamic portion of the hook name, `$name`, refers to the key name of the modification array. For example, 'header_textcolor', 'header_image', and so on depending on the theme options.

Hook Information

File Location wp-includes/theme.php View on GitHub
Hook Type Filter
Line Number 1082

Hook Parameters

Type Name Description
mixed $current_mod The value of the active theme modification.

Usage Examples

Basic Usage
<?php
// Hook into theme_mod_{$name}
add_filter('theme_mod_{$name}', 'my_custom_filter', 10, 1);

function my_custom_filter($current_mod) {
    // Your custom filtering logic here
    return $current_mod;
}

Source Code Context

wp-includes/theme.php:1082 - How this hook is used in WordPress core
<?php
1077  			$default_value = sprintf( $default_value, get_template_directory_uri(), get_stylesheet_directory_uri() );
1078  		}
1079  	}
1080  
1081  	/** This filter is documented in wp-includes/theme.php */
1082  	return apply_filters( "theme_mod_{$name}", $default_value );
1083  }
1084  
1085  /**
1086   * Updates theme modification value for the active theme.
1087   *

PHP Documentation

<?php
/**
		 * Filters the theme modification, or 'theme_mod', value.
		 *
		 * The dynamic portion of the hook name, `$name`, refers to the key name
		 * of the modification array. For example, 'header_textcolor', 'header_image',
		 * and so on depending on the theme options.
		 *
		 * @since 2.2.0
		 *
		 * @param mixed $current_mod The value of the active theme modification.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/theme.php
Related Hooks

Related hooks will be displayed here in future updates.